examples: add vision odometry example#820
Open
alireza787b wants to merge 4 commits intomavlink:mainfrom
Open
Conversation
2f48606 to
7e362d8
Compare
This was referenced Mar 10, 2026
Merged
7e362d8 to
5fa5637
Compare
Add a practical example showing how to send visual odometry data to PX4 via the Mocap plugin's Odometry message. Demonstrates connecting to PX4 SITL, configuring EKF2 for vision fusion (EKF2_EV_CTRL, EKF2_HGT_REF), sending ODOMETRY at 30 Hz, and monitoring health to verify fusion is active.
5fa5637 to
145905e
Compare
Rewrites the vision odometry example to use a ground truth feedback approach: reads the drone's actual position in simulation, adds configurable noise and delay, and feeds it back as vision odometry. The drone takes off and hovers while the VIO feed runs, showing real-time EKF2 fusion status. Uses new Odometry fields (reset_counter, estimator_type, quality) from MAVSDK-Proto PR mavlink#395 / MAVSDK PR #2791. Includes a startup validation that prints a clear error if these fields are not yet available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The vision odometry example now does NOT arm, takeoff, or control the drone. It only feeds VIO data. The user flies the drone however they like (QGroundControl, RC, mission, another script) while this runs alongside. Press Ctrl+C to stop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Match proto field rename from MAVSDK-Proto PR mavlink#395 review feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Thanks for the review Jonas! Just pushed a small update renaming |
julianoes
approved these changes
Mar 30, 2026
Collaborator
julianoes
left a comment
There was a problem hiding this comment.
Good to be merged? The todos in the PR description aren't ticked, so I'm not so sure.
Contributor
Author
|
Hey Juliano, not yet. You are right that the description there was stale, thanks for flagging it. I just cleaned that up. This example is waiting on the fresh proto PR ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a vision odometry example that feeds simulated VIO data to PX4 using the MAVSDK Mocap plugin, for testing and education.
This script does NOT arm, takeoff, or control the drone. It only feeds VIO data in the background. You fly the drone however you like (QGroundControl, RC, mission, or another MAVSDK script) while this runs alongside.
Current status
This PR is not merge-ready yet.
It is waiting on the fresh upstream mocap path:
The earlier dependency chain in this PR description was stale:
After the proto/C++ path is settled, this example still needs one final pass and verification before it should be merged.
Planned follow-up for this PR
Test plan
Pending the upstream mocap proto/C++ path.